﻿using Internal.Runtime.Services.Battle;
using Runtime.Models;

namespace Runtime.Services.Battle {

    /// <summary>
    /// 单元格
    /// </summary>
    public interface IDFR_BattleCell : IDFR_Entity {

        /// <summary>
        /// ID
        /// </summary>
        DFR_BattleCellID ID { get; }

        /// <summary>
        /// 下一个单元格ID
        /// </summary>
        DFR_BattleCellID RoadNextID { get; }

        /// <summary>
        /// 数据
        /// </summary>
        IDFR_BattleCellModelTD Model { get; }
    }

    public class DFR_BattleCell : DFR_Entity, IDFR_BattleCell, IDFR_BattleCellInternal {

        private IDFR_BattleCellModelTDSetter m_Model;

        public DFR_BattleCellID ID { get; init; }

        public DFR_BattleCellID RoadNextID { get; init; }

        public IDFR_BattleCellModelTD Model => m_Model;

        void IDFR_BattleCellInternal.Initialize(IDFR_BattleCellModelTD model) {
            m_Model = (IDFR_BattleCellModelTDSetter)model;
        }

        protected override void Dispose() {
            m_Model = null;
            base.Dispose();
        }
    }
}

namespace Internal.Runtime.Services.Battle {

    public interface IDFR_BattleCellInternal {

        void Initialize(IDFR_BattleCellModelTD model);
    }
}
